﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using System.ComponentModel.DataAnnotations;

namespace Windvoice.Blog
{
    [ActiveRecord("Link")]
    public partial class Link : ActiveRecordBase<Link>
    {
        [PrimaryKey(PrimaryKeyType.Identity, "ID")]
        public int ID
        {
            get;
            set;
        }

        [Display(Name="名称/图片")]
        [Required]
        [Property]
        public string Title
        {
            get;
            set;
        }

        [Display(Name = "描述")]
        [Property]
        public string Content
        {
            get;
            set;
        }

        [Display(Name = "链接Url")]
        [Required]
        [Property]
        public string LinkUrl
        {
            get;
            set;
        }

        [Display(Name = "链接类型")]
        [Required]
        [Property]
        public int Type
        {
            get;
            set;
        }

        [Display(Name = "是否启用")]
        [Required]
        [Property]
        public bool IsEnable
        {
            get;
            set;
        }

        [Property]
        public DateTime CreateTime
        {
            get;
            set;
        }
    }

    public enum LinkType
    {
        Image=2,
        Text=1
    }
}
